// pages/collect/collect.js
Page({
  data: {
    // 我的收藏和浏览记录  数据
    mealsList:[
      // 我的收藏数据
      {
        option:'我的收藏',
        section:[
          {
            imgSrc:'../static/upload/05_1.jpg',
            title:'《#卷心菜#》#卷心菜豆腐卷#',
            stuff:'卷心菜，高筋面粉，牛奶，好吃好吃超出好吃',
            author:'淡然6257',
            browse:5.1,
            collect:6888,
          },
        ]
      },
      // 浏览记录数据
      {
        option:'浏览记录',
        section:[
          {
            imgSrc:'../static/upload/05_1.jpg',
            title:'《#卷心菜#》#卷心菜豆腐卷#',
            stuff:'卷心菜，高筋面粉，牛奶，好吃好吃超出好吃',
            author:'淡然6257',
            browse:5.1,
            collect:6888,
          },
          {
            imgSrc:'../static/upload/06_1.jpg',
            title:'彩色饼干（新年甜品)',
            stuff:'彩色饼干，高筋面粉，牛奶，好吃好吃超出好吃',
            author:'橘子香味',
            browse:6.8,
            collect:354,
          },
          {
            imgSrc:'../static/upload/07_1.jpg',
            title:'蔓越莓牛轧糖(微波炉版))',
            stuff:'蔓越莓牛轧糖，高筋面粉，牛奶，好吃好吃超出好吃',
            author:'倾听-小熙',
            browse:16.5,
            collect:3618,
          },
        ]
      }
    ],
    // 当前滑块的索引
    currentTab:0
  },
  // 点击搜索框跳转到搜索详情页
  ToSearchDetails(){
    wx.navigateTo({
      // 注意不要加后缀名.wxml
      url: '../SearchDetails/SearchDetails',
    })
  },
  // 点击切换
  selected(e){
    let index = e.currentTarget.dataset['suo']
    this.dealTab(index)
  },
  //滑动切换
  swiperTab(e){
    let swiperIndex = e.detail.current;
    this.dealTab(swiperIndex)
  },
  dealTab(index){
    this.setData({
      currentTab:index
    })
  }
})